package com.chinapost.po;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Tyglb entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "TYGLB", schema = "YXJF")
public class Tyglb implements java.io.Serializable {

	// Fields

	private Integer cid;
	private String cname;
	private Set<Tuser> tusers = new HashSet<Tuser>(0);
	private Set<Tjhrw> tjhrws = new HashSet<Tjhrw>(0);

	// Constructors

	/** default constructor */
	public Tyglb() {
	}

	/** minimal constructor */
	public Tyglb(Integer cid, String cname) {
		this.cid = cid;
		this.cname = cname;
	}

	/** full constructor */
	public Tyglb(Integer cid, String cname, Set<Tuser> tusers, Set<Tjhrw> tjhrws) {
		this.cid = cid;
		this.cname = cname;
		this.tusers = tusers;
		this.tjhrws = tjhrws;
	}

	// Property accessors
	@Id
	@Column(name = "CID", unique = true, nullable = false, precision = 5, scale = 0)
	public Integer getCid() {
		return this.cid;
	}

	public void setCid(Integer cid) {
		this.cid = cid;
	}

	@Column(name = "CNAME", nullable = false, length = 30)
	public String getCname() {
		return this.cname;
	}

	public void setCname(String cname) {
		this.cname = cname;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tyglb")
	public Set<Tuser> getTusers() {
		return this.tusers;
	}

	public void setTusers(Set<Tuser> tusers) {
		this.tusers = tusers;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tyglb")
	public Set<Tjhrw> getTjhrws() {
		return this.tjhrws;
	}

	public void setTjhrws(Set<Tjhrw> tjhrws) {
		this.tjhrws = tjhrws;
	}

}